package logic

import (
	"context"
	"furni-suite/models/mysql"

	"furni-suite/furnirpc/furnirpc"
	"furni-suite/furnirpc/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type UserListLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewUserListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserListLogic {
	return &UserListLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 用户列表查询
func (l *UserListLogic) UserList(in *furnirpc.UserListRequest) (*furnirpc.UserListResponse, error) {
	// todo: add your logic here and delete this line

	var list []*furnirpc.UserList

	list = mysql.UserList(mysql.DB)
	return &furnirpc.UserListResponse{
		List: list,
	}, nil
}
